package view.cloudFactory;

import com.jfoenix.controls.JFXTextField;
import dao.OrderDao;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import view.Main;

/**
 * @author Limohan
 */
public class AddBidPriceController {
    private Main myApp;
    private static String orderId;
    private static String factory;
    public void setApp(Main myApp) {
        this.myApp = myApp;
    }

    public void setFactory(String factory) {
        AddBidPriceController.factory = factory;
    }

    public void setOrderId(String orderId) {
        AddBidPriceController.orderId = orderId;
    }

    public AddBidPriceController() {
    }

    @FXML
    private JFXTextField bidPrice;

    @FXML
    void comfirmPrice(ActionEvent event) throws Exception {
        OrderDao orderDao = new OrderDao();
        orderDao.setBidPrice(bidPrice.getText(),orderId,factory);
        myApp.goToFactoryOrderPage();
   }

}
